import java.util.Scanner;

/*
    判断几位数
 */
public class MothodDemo09 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数:");
        int num = sc.nextInt();
        int count = count(num);
        System.out.println(num + "是" + count + "位数字");
    }

    public static int count(int num) {
        int count = 1;
        for (int i = 0; true; i++) {
            if (num / 10 != 0) {
                num /= 10;
                count++;
            } else {
                break;
            }
        }
        return count;
    }
}
